<template>
  <el-dialog title="查看" :visible.sync="dialogVisible" width="60%" class="popup" :before-close="handleClose">
    <!-- tab切换 -->
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="信息列表" name="first">
        <el-table :data="tableData" stripe border :max-height="maxTableHeight" style="width: 100%">
          <el-table-column type="index" label="序号" width="50" resizable />
          <el-table-column prop="date" label="公告标题" resizable sortable show-overflow-tooltip align="left" />
          <el-table-column prop="name" label="公告类型" resizable />
          <el-table-column prop="name" label="状态" resizable />
          <el-table-column prop="name" label="创建人" resizable />
          <el-table-column prop="address" label="创建时间" resizable />
          <el-table-column prop="address" label="发布时间" resizable />
          <el-table-column prop="address" label="审批状态" resizable />
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="审批流程" name="second">
        <el-table :data="tableData" stripe border :max-height="maxTableHeight" style="width: 100%">
          <el-table-column type="index" label="序号" width="50" resizable />
          <el-table-column prop="date" label="审批人" resizable sortable show-overflow-tooltip align="left" />
          <el-table-column prop="name" label="审批时间" resizable />
          <el-table-column prop="name" label="审批状态" resizable />
          <el-table-column prop="name" label="审批级别" resizable />
          <el-table-column prop="address" label="审批描述" resizable />
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="dialogVisible = false">取消</el-button>
      <el-button type="primary" size="small" @click="dialogVisible = false">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
  components: {
  },
  data () {
    return {
      dialogVisible: false,
      ruleForm: {
        pass: '',
        checkPass: '',
        age: ''
      },
      activeName: 'first',
      formInline: {
        user: '',
        region: '',
        deptId: []
      },
      value1: '',
      input2: '',
      value: null,
      // define options
      options: [{
        id: 'a',
        label: 'a',
        children: [{
          id: 'aa',
          label: 'aa',
        }, {
          id: 'ab',
          label: 'ab',
        }],
      }, {
        id: 'b',
        label: 'b',
      }, {
        id: 'c',
        label: 'c',
      }],
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    }
  },
  computed: {
    rules () {
      return {
        pass: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
        ],
        checkPass: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
        ],
        age: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
        ]
      }
    }

  },
  methods: {
    toggleSees (flag) {
      this.dialogVisible = flag
    },
    handleClose (done) {
      this.$confirm('确认关闭？')
        .then(_ => {
          done()
        })
        .catch(_ => { })
    }
  }
};
</script>

<style lang="scss" scoped>
.el-descriptions {
  border-bottom: 1px solid #cdd0db;
}

.popup {
  ::v-deep .el-dialog {
    border-radius: 4px;
    // padding: 0 30px 30px 30px !important;
  }
  ::v-deep .el-dialog__header {
    border-bottom: 1px solid #cdd0db;
  }
  ::v-deep .el-dialog__body {
    padding: 30px;
  }
}
</style>

